package com.inspire.springboot.dbutil;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * @author ：inspire
 * @date ：Created in 2022/10/14 9:44
 * @description：
 * @modified By：inspire
 * @version:
 */
public class DBHelper {

    public Connection getConnection(JdbcType jdbcType) {
        Connection conn = null;
        try {
            Class.forName(jdbcType.getJdbcName());
            conn = DriverManager.getConnection(jdbcType.getUrl(), jdbcType.getUserName(), jdbcType.getPassword());
        } catch (Exception e) {
            e.printStackTrace();
        }
        return conn;
    }
}